home *** CD-ROM | disk | FTP | other *** search
/ Aminet 41 / Aminet 41 (2001)(Schatztruhe)[!][Feb 2001].iso / Aminet / gfx / edit / AmiCAD_2.07.lha / AmiCAD / ARexx / Majuscules.amiCAD < prev    next >
Text File  |  2000-11-10  |  2KB  |  73 lines

  1. /* Script ARexx permettant la conversion d'un objet texte en MAJUSCULES
  2.    Chez Corbin, 7 Octobre 1997,  Version 1.00, © R.Florac
  3.         7 Décembre 1997, version 1.01: extension à tous les objets sélectionnés
  4.            13 avril 1998,     version 1.02: ajout SAVEALL
  5.            27 Février 1999,  version 1.03: ajout INIT variable
  6.            13 avril 2000,     version 1.04: adaptation version 2.05
  7.            10 novembre 2000, version 1.05: localisation anglais/français
  8. $VER: Majuscules.AmiCAD 1.05 (© R.Florac, 10/11/2000) */
  9.  
  10. options results
  11.  
  12. signal on error
  13. signal on syntax
  14.  
  15. 'LANGUAGE'
  16. if result="français.language" then fr=1
  17. else fr=0
  18.  
  19. 'INIT(OBJET):OBJET=FIRSTSEL'; objet = result
  20. if objet = 0 then do
  21.     if fr=1 then 'MESSAGE("Il n''y a aucun objet"+CHR(10)+"qui soit sélectionné"):INIT(OBJET)'
  22.     else 'MESSAGE("There is no selected object"):INIT(OBJET)'
  23.     exit
  24. end
  25.  
  26. 'SAVEALL'
  27. do while objet > 0            /* version 1.01 */
  28.     'TYPE(OBJET)'; type = result
  29.     'READTEXT(OBJET)'; texte = result
  30.  
  31.     i = 1
  32.     l = length(texte)
  33.     do while i <= l
  34.  
  35.     curletter = substr(texte, i, 1)
  36.     if curletter = ' ' then
  37.     do
  38.            i = i + 1
  39.            iterate
  40.     end
  41.  
  42.     texte = overlay(upper(curletter), texte, i)
  43.  
  44.     i = i + 1
  45.     end
  46.  
  47.     select
  48.     when type = 4 then 'SETTEXT(OBJET,"'texte'")'
  49.     when type = 5 then 'SETTEXT(OBJET,"'texte'")'
  50.     when type = 6 then 'SETTEXT(OBJET,"'texte'")'
  51.     when type = 11 then 'SETTEXT(OBJET,"'texte'")'
  52.     when type = 12 then 'SETTEXT(OBJET,"'texte'")'
  53.     otherwise nop
  54.     end
  55.  
  56.     'OBJET=NEXTSEL(OBJET)'; objet = result
  57.     if objet=0 then leave
  58. end
  59. 'INIT(OBJET)'
  60. exit
  61.  
  62. /* Traitement des erreurs, interruption du programme */
  63. syntax:
  64. erreur=RC
  65. if fr=1 then 'MESSAGE("Script Majuscules.AmiCAD:"+CHR(10)+"Erreur de syntaxe"+CHR(10)+"en ligne 'SIGL'"+CHR(10)+"'errortext(erreur)'"):INIT(OBJET)'
  66. else 'MESSAGE("Majuscules.AmiCAD script"+CHR(10)+"Syntax error"+CHR(10)+"in line 'SIGL'"+CHR(10)+"'errortext(erreur)'"):INIT(OBJET)'
  67. exit
  68.  
  69. error:
  70. if fr=1 then 'MESSAGE("Script Majuscules.AmiCAD:"+CHR(10)+"Erreur en ligne 'SIGL'"):INIT(OBJET)'
  71. else 'MESSAGE("Majuscules.AmiCAD script:"+CHR(10)+"Error in line 'SIGL'"):INIT(OBJET)'
  72. exit
  73.